import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "../views/Home";
import ProjectManage from "../views/project/ProjectManage";
import ProjectList from "@/views/project/ProjectList";
import TestPage from "@/views/apiTest/TestPage";
import TestPage_HTTP from "@/views/apiTest/TestPage_HTTP";
import TestPage_UDP from "@/views/apiTest/TestPage_UDP";
import TestPage_TCP from "@/views/apiTest/TestPage_TCP";
import TestPage_MQTT_pub from "@/views/apiTest/TestPage_MQTT_pub";
import TestPage_MQTT_sub from "@/views/apiTest/TestPage_MQTT_sub";

Vue.use(VueRouter);

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
        redirect: '/testPage',
        children: [
            {
                path: '/testPage',
                name: 'TestPage',
                component: TestPage,
                redirect: '/testPage_HTTP',
                children: [
                    {
                        path: '/testPage_HTTP',
                        name: 'TestPage_HTTP',
                        component: TestPage_HTTP,
                    },
                    {
                        path: '/testPage_TCP',
                        name: 'TestPage_TCP',
                        component: TestPage_TCP,
                    },
                    {
                        path: '/testPage_UDP',
                        name: 'TestPage_UDP',
                        component: TestPage_UDP,
                    },
                    {
                        path: '/testPage_MQTT_pub',
                        name: 'TestPage_MQTT_pub',
                        component: TestPage_MQTT_pub,
                    },
                    {
                        path: '/testPage_MQTT_sub',
                        name: 'TestPage_MQTT_sub',
                        component: TestPage_MQTT_sub,
                    }
                ]
            },
            {
                path: '/projectManage',
                name: 'ProjectManage',
                component: ProjectManage,
                children: [
                    {
                        path: '/projectList',
                        name: 'ProjectList',
                        component: ProjectList,
                    }
                ]
            }
        ]
    }
];

const router = new VueRouter({
    routes
});

export default router
